home *** CD-ROM | disk | FTP | other *** search
/ Sunday Savers: Singing Fun! / Sunday Savers: Singing Fun!.iso / mac / Xtras / Buddy API 1.6 / Buddy API Docs.swf / texts / 1522.txt < prev    next >
Encoding:
Text File  |  2004-08-31  |  2.4 KB  |  109 lines

  1. 123
  2. --- RECORDSEPARATOR ---
  3.  
  4. --- RECORDSEPARATOR ---
  5. FilePermissions 
  6. --- RECORDSEPARATOR ---
  7. Platform:
  8. --- RECORDSEPARATOR ---
  9.  
  10. --- RECORDSEPARATOR ---
  11. Macintosh
  12. --- RECORDSEPARATOR ---
  13.  
  14. --- RECORDSEPARATOR ---
  15. Description:
  16. --- RECORDSEPARATOR ---
  17.  
  18. --- RECORDSEPARATOR ---
  19. baFilePermissions returns the UNIX permissions of a file or folder.
  20. --- RECORDSEPARATOR ---
  21.  
  22. --- RECORDSEPARATOR ---
  23. Usage:
  24. --- RECORDSEPARATOR ---
  25.  
  26. --- RECORDSEPARATOR ---
  27. Result = baFilePermissions( FileName, User )
  28. --- RECORDSEPARATOR ---
  29.  
  30. --- RECORDSEPARATOR ---
  31. Arguments:
  32. --- RECORDSEPARATOR ---
  33.  
  34. --- RECORDSEPARATOR ---
  35. String, string. 
  36. --- RECORDSEPARATOR ---
  37. FileName is the file to get the attribute of. 
  38. --- RECORDSEPARATOR ---
  39. User is the user type to get. Can be one of: 
  40. --- RECORDSEPARATOR ---
  41. "u" 
  42. --- RECORDSEPARATOR ---
  43. the present user 
  44. --- RECORDSEPARATOR ---
  45. "g" 
  46. --- RECORDSEPARATOR ---
  47. the current group 
  48. --- RECORDSEPARATOR ---
  49. "o" 
  50. --- RECORDSEPARATOR ---
  51. all other users
  52. --- RECORDSEPARATOR ---
  53.  
  54. --- RECORDSEPARATOR ---
  55. Returns:
  56. --- RECORDSEPARATOR ---
  57.  
  58. --- RECORDSEPARATOR ---
  59. String. 
  60. --- RECORDSEPARATOR ---
  61. Returns a string containing all the file permissions that are set. 
  62. --- RECORDSEPARATOR ---
  63. Can be a combination of: 
  64. --- RECORDSEPARATOR ---
  65. "r" 
  66. --- RECORDSEPARATOR ---
  67. read access allowed 
  68. --- RECORDSEPARATOR ---
  69. "w" 
  70. --- RECORDSEPARATOR ---
  71. write access allowed 
  72. --- RECORDSEPARATOR ---
  73. "x" 
  74. --- RECORDSEPARATOR ---
  75. execute access allowed
  76. --- RECORDSEPARATOR ---
  77.  
  78. --- RECORDSEPARATOR ---
  79. Examples:
  80. --- RECORDSEPARATOR ---
  81.  
  82. --- RECORDSEPARATOR ---
  83. Director: 
  84. --- RECORDSEPARATOR ---
  85. perm = baFilePermissions( "Mac HD:data:student.dat", "u" ) 
  86. --- RECORDSEPARATOR ---
  87. Authorware: 
  88. --- RECORDSEPARATOR ---
  89. perm := baFilePermissions( "Mac HD:data:student.dat", "u" )
  90. --- RECORDSEPARATOR ---
  91.  
  92. --- RECORDSEPARATOR ---
  93. Notes:
  94. --- RECORDSEPARATOR ---
  95.  
  96. --- RECORDSEPARATOR ---
  97. This function only works under OSX. 
  98. --- RECORDSEPARATOR ---
  99. You can use the Director contains or Authorware Find functions to test whether a 
  100. --- RECORDSEPARATOR ---
  101. particular attribute is set. eg. 
  102. --- RECORDSEPARATOR ---
  103. if Find( "r", baFilePermissions( File ) ) <> 0 then -- file has read access 
  104. --- RECORDSEPARATOR ---
  105. if baFilePermissions( Filename ) contains "r" then -- file has read access 
  106. --- RECORDSEPARATOR ---
  107. To get the permissions of a folder, you need to make sure that the folder name 
  108. --- RECORDSEPARATOR ---
  109. ends with a :